Ext.define('JRainbow.common.LeftMenu', {
    extend: 'Ext.tree.Panel',
    xtype: 'left-menu',
    useArrows: true,
    rootVisible: false,
    initComponent: function() {
        Ext.apply(this, {
            store: new Ext.data.TreeStore({
            	 autoLoad : true,
                 proxy: {
                     type: 'ajax',
                     url: 'rainbow/menu!query.action',
                     reader: {
                         type: 'json',
                         root: 'children'
                     }
                 },
                 sorters: [{
                     property: 'leaf',
                     direction: 'ASC'
                 }],
                 root: {
                     nodeType: 'async',
                     text: 'JRainbow',
                     expanded: true
                 }
            }),
            viewConfig: {
                plugins: {
                    ptype: 'treeviewdragdrop',
                    containerScroll: true
                }
            }
        });
        this.callParent();
    }
});